package com.xu.sys.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


public class DateUtils {
    public static final String DATE_PARTTERN1 = "yy-MM-DD hh:mm:ss";

    public static Date stringToDate(String msg, String pattern) {
        SimpleDateFormat formatter = new SimpleDateFormat(pattern);
        Date date = null;
        try {
            date = formatter.parse(msg);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
}


